package Ventanas.Listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.JButton;
import javax.swing.JFrame;

import Negocio.Cliente;
import Negocio.Libro;
import Ventanas.GestionClientes;
import Ventanas.GestionLibrosStock;
import Ventanas.GestionPedidos;

public class VentanaPrincipalActionListener implements ActionListener{

	JButton bGestionClientes, bLibrosStock, bPedidos; 
	GestionClientes gestionClientes;
	GestionLibrosStock gestionLibrosStock;
	GestionPedidos gestionPedidos;
	JFrame principal;
	
	public VentanaPrincipalActionListener(JButton bgestionClientes, JButton bgestionLibros, JButton bpedidos,
			GestionClientes gestionClientes, GestionLibrosStock gestionLibrosStock,GestionPedidos gestionPedidos,JFrame principal){
		this.bGestionClientes = bgestionClientes;
		this.bLibrosStock = bLibrosStock;
		this.bPedidos = bpedidos;
		
		this.gestionClientes = gestionClientes;
		this.gestionLibrosStock = gestionLibrosStock;
		this.gestionPedidos = gestionPedidos;
		this.principal = principal;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if( e.getActionCommand().equals("bClientes")){
			gestionClientes.gestionClientes.setVisible(true);
		}else if (e.getActionCommand().equals("bLibrosStock")){
			gestionLibrosStock.gestionLibrosStock.setVisible(true);
		}else if (e.getActionCommand().equals("bPedidos")){
			gestionPedidos.ventanaPedido.setVisible(true);
		}
		principal.setVisible(false);
		
	}
	
	

}
